<?php
namespace app\business\controller;
use think\Controller;
use think\Session;

class Base extends Controller
{
    public function _initialize(){
        if(!session('username')){
            $this->error('请先登录系统！','login/index');
        }else{
            $username=Session::get('username');
            $this->assign('username',$username);
        }
    }
}